<template>
	<view class="list_xq">
		<text class="style1">
			{{text.name}}
		</text>
			<rich-text class="contont" :nodes="text.content">
			</rich-text>
		<!-- <a style="margin: 20upx 0 20upx 40upx" :href="text.url">课件下载</a> -->
		<view v-if="text.downUrl">
			<text v-for="(item,index) in text.downUrl" class="downLoadBtn" @tap="xiazai(item.downUrl)">{{item.fileName}}</text>
		</view>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				id:[],
				text:[],
			}
		},
		methods:{
			xiazai(url) {
				plus.runtime.openURL(downUrl, function(res) {  
				                        // console.log(res);  
				                    });
				}
		},
		onLoad(option) {			this.id = option.id			console.log(this.id)		},
		created() {
			let that = this
			let params = {
				"id":that.id,
			}
			that.pyReq(that.$http.getMindClazzChapterDetail,params,function(res){
					  that.text = res.result
					  console.log(that.text);
					  
			});
			// let headers={
			// 	  'content-type': 'application/x-www-form-urlencoded',
			// 	  'token': uni.getStorageSync('token')
			// }
			//  uni.request({
			// 	  url: that.$http.getMindClazzChapterDetail,
			// 	  method: 'POST',
			// 	  data:params,
			// 	  header:headers,
			// 	  success: (res)=>{
			// 		  console.log(res)
			// 		  that.text = res.data.result
			// 	  },
			// 	  fail: (err)=>{
			// 		  console.log(err)
			// 	  }
			// }) 
		}
	}
</script>

<style>
	.style1{
		font-size: 30upx;
		font-weight: bold;
	}
	.list_xq{
		font-size: 26upx;
		color: #333333;
		margin-bottom: 10upx;
		padding-bottom: 10upx;
	}
	.list_xq > text{
		display: block;
		margin: 30upx 44upx;
		line-height: 40upx;
	}
	.contont{
		font-size: 26upx;
		display: block;
		margin: 10upx 44upx;
		line-height: 33upx;
	}
	.downLoadBtn{
		width: 200upx;
		height: 50upx;
		margin: 0upx 0 0upx 40upx;
		font-size: 24upx;
		line-height: 50upx;
		color: #BA2B26;
		
		display: block;
		/* margin: 30upx 44upx; */
		/* line-height: 40upx; */
	}
</style>
